﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MainMaster.Master" AutoEventWireup="true" CodeBehind="ProductList.aspx.cs" Inherits="ZLCMS.Web.Product.ProductList" %>

<%@ Import Namespace="ZLCMS.Business.Util" %>
<%@ Register src="UC/CategorySearchPropertyItems.ascx" tagname="CategorySearchPropertyItems" tagprefix="uc1" %>
<%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" TagPrefix="webdiyer" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
<script type="text/javascript">
    $(document).ready(function (e) {
        $('.pagebox').show();
    });

    //排序
    function Order(ct) {
        var defaultorderurl = '/product/ProductList.aspx?tagid=<%=Request["tagid"] %>&a=a'; //&categoryid=<%= Request["categoryid"] %>';
        if ('<%= Request["keyword"]%>' != '') {
            defaultorderurl += '&keyword=<%=Request["keyword"]%>';
            window.location.href = defaultorderurl;
        }
        if ('<%= Request["categoryid"]%>'!='')
        {
            defaultorderurl += '&categoryid=<%= Request["categoryid"] %>';
        }
        var orderby = $(ct).attr("orderby");

          var keyword = $.trim('<%= Request["keyword"]%>');
          var asc = '<%= Request["asc"]%>';
        if (orderby == 'score') {
            defaultorderurl += '&orderby=score';
            if (asc == '1') {
                defaultorderurl += '&asc=0';
            }
            else {
                defaultorderurl += '&asc=1';
            }
        }
        else if (orderby == 'saleprice') {
            defaultorderurl += '&orderby=saleprice';
            if (asc == '1') {
                defaultorderurl += '&asc=0';
            }
            else {
                defaultorderurl += '&asc=1';
            }
        }
        else if (orderby == 'addtime') {
            defaultorderurl += '&orderby=addtime';
            if (asc == '1') {
                defaultorderurl += '&asc=0';
            }
            else {
                defaultorderurl += '&asc=1';
            }
        }
        else if (orderby == 'sellcount') {
            defaultorderurl += '&orderby=sellcount';
            if (asc == '1') {
                defaultorderurl += '&asc=0';
            }
            else {
                defaultorderurl += '&asc=1';
            }
        }

        $("#div_category_search_property").find("li[name]").each(function () {
            var itemId = $(this).find("a[name=item_" + $(this).attr("name") + "][class]").first().attr("propertyitemid");
            if (itemId == undefined) {
                itemId = "";
            }
            defaultorderurl += "&" + $(this).attr("name") + "=" + itemId;
        });

        window.location.href = defaultorderurl;
    }
    </script>
    <style type="text/css">
    .pro li{ margin-bottom:35px;width: 228px;}
  
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<div id="wrapper">
	<div class="left_box">
    
    </div>
	<div class="right_box">
        <!--分类筛选 start-->
          <uc1:CategorySearchPropertyItems  ID="CategorySearchPropertyItems1" runat="server"/>

   
        <!--分类筛选 end-->
        
        <!--排序 start-->
        <div class="product_px"  <%=  string.IsNullOrEmpty(Request["categoryid"])?" style='display:block;'":"" %>>
            <%--<img src="/MemberUser/images/product_listicon.png" width="23" height="22" />--%>
            <h3>商品列表</h3>
            <div class="shanp_px">
                <a href="#" <%=Request["orderby"]==""?"class='moren'":""%>   orderby="" onclick="Order(this)" id="a_Default">
                    <span>默认排序</span>
                </a>
                <a href="#" <%=Request["orderby"]=="sellcount"?"class='moren'":""%>   orderby="sellcount" onclick="Order(this)" id="a_Sellcount">
                    <span>销量</span>
                    <span class="icon" style='background: url("/MemberUser/images/shangp_px_icon<%= (Request["orderby"]=="sellcount"&&Request["asc"]=="0")?"":"1"%>.png") no-repeat scroll right center rgba(0, 0, 0, 0);'></span>
                </a>

                <a href="#" <%=Request["orderby"]=="saleprice"?"class='moren'":""%>  orderby="saleprice" onclick="Order(this)" id="a_SalePrice">
                    <span>价格</span>
                    <span class="icon" style='background: url("/MemberUser/images/shangp_px_icon<%= (Request["orderby"]=="saleprice"&&Request["asc"]=="0")?"":"1"%>.png") no-repeat scroll right center rgba(0, 0, 0, 0);'></span>
                </a>
                <a href="#" <%=Request["orderby"]=="score"?"class='moren'":""%>  orderby="score" onclick="Order(this)" id="a_Score">
                    <span>好评</span>
                    <span class="icon" style='background: url("/MemberUser/images/shangp_px_icon<%= (Request["orderby"]=="score"&&Request["asc"]=="0")?"":"1"%>.png") no-repeat scroll right center rgba(0, 0, 0, 0);'></span>
                </a>
                <a href="#" <%=Request["orderby"]=="addtime"?"class='moren'":""%>  orderby="addtime" onclick="Order(this)" id="a_Addtime">
                    <span>发布时间</span>
                    <span class="icon" style='background: url("/MemberUser/images/shangp_px_icon<%= (Request["orderby"]=="addtime"&&Request["asc"]=="0")?"":"1"%>.png") no-repeat scroll right center rgba(0, 0, 0, 0);'></span>
                </a>
            </div>
            <div class="clear"></div>
        </div>
        <!--排序 end-->
        
        <!--列表 start-->
        <ul class="pro">
        
        <asp:Repeater ID="rpt_pro" runat="server">
            <ItemTemplate>
                <li>
                <a target="_blank" href="/Product/ProductDetail.aspx?no=<%# ((IDictionary)Container.DataItem)["PRODUCT_NO"] %>">
                    <img class="lazy"  src="/images/loading.gif" data-original="<%# FileKit.FirstImgPathThumb(((IDictionary)Container.DataItem)["THUMBNAIL_IMG"] as string)  %>" width="226" height="226"/>
                    <div class="box">
                        <h2><%# ((IDictionary)Container.DataItem)["PRODUCT_NAME"]%></h2>
                        <div class="text"><%# ((IDictionary)Container.DataItem)["SHORT_DESC"]%></div>
                        <p>RMB: <%# ((IDictionary)Container.DataItem)["SALE_PRICE"] %><span>原价: <%# ((IDictionary)Container.DataItem)["MARKET_PRICE"]%></span></p>
                    </div>
                </a>
            </li>
            </ItemTemplate>
            </asp:Repeater>
            <div class="clear"></div>
        </ul>




        <%--<ul class="product_list">
            
              <li><a href='/Product/ProductDetail.aspx?no=<%# ((IDictionary)Container.DataItem)["PRODUCT_NO"] %>'><img src='<%# FileKit.FirstImgPathThumb(((IDictionary)Container.DataItem)["THUMBNAIL_IMG"] as string) %>' width="226" height="226" /></a>
                        <div class="f_box">
                            <div class="f_text"><a href='#'><%# ((IDictionary)Container.DataItem)["PRODUCT_NAME"]%></a></div>
                            <div class="f_mo">
                                <div class="money">
                                    <p>RMB:&nbsp;<span><%# ((IDictionary)Container.DataItem)["SALE_PRICE"] %></span></p>
                                    <p class="yuanjia">原价:&nbsp;<span><%# ((IDictionary)Container.DataItem)["MARKET_PRICE"]%></span></p>
                                </div>
                                <div class="position"><a href="#"><img src="/MemberUser/images/lingqu_icon.png" width="67" height="26" /></a></div>
                            </div>
                        </div>
                    </li>
            
               
                    <div class="clear"></div>
                </ul>--%>
        <!--列表 end-->
        
        <!--分页 start-->
      <p>  <div id="pages" class="pagee"> <webdiyer:AspNetPager ID="anp_list" runat="server" CssClass="pages" 
             CurrentPageButtonClass="cpb" PageSize="8" UrlPaging="True" 
             PageIndexBoxType="DropDownList" CurrentPageButtonPosition="Center" 
             NavigationButtonsPosition="Right" ShowBoxThreshold="0" ShowFirstLast="False" 
             ShowMoreButtons="False" ShowPageIndex="True" FirstPageText="首页" LastPageText="末页" NextPageText="下一页" PrevPageText="上一页" ShowPageIndexBox="Never">
        </webdiyer:AspNetPager><%--<a class="a1">163条</a><a href="">第一页</a><a href="">上一页</a><span>1</span><a href="">2</a><a href="">3</a><a href="">4</a><a href="">5</a><a href="">下一页</a><a href="">最后一页</a>--%></div>
          </p>
        </div>
        <!--分页 end-->
	</div>
</asp:Content>

